package com.esxy.pojo;

import com.baomidou.mybatisplus.annotation.*;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Date;
@Data
@AllArgsConstructor //有参构造
@NoArgsConstructor  //无参构造
public class TUser {

    @TableId(value = "id" ,type = IdType.AUTO)
    private Long id;

    private String userName;

    private Integer age;

    private String email;

    private String password;

    private String sex;

    //mp会自动执行新增时间的操作
    @TableField(fill = FieldFill.INSERT)
    private Date createTime;//新增

    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Date updateTime;//修改

    @TableField(fill = FieldFill.INSERT)
    @TableLogic//逻辑删除
    private  Integer isDelete;

    //自动增长，或手动先设置数值
    @TableField(fill = FieldFill.INSERT)//通过自动填充来帮助我们完成版本初始值
    @Version//版本号
    private Integer version;

}
